package com.itheima.controller;

import com.itheima.queryParams.CartInfo;
import com.itheima.pojo.Result;
import com.itheima.service.CartService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cart")
@RequiredArgsConstructor
public class CartController {
    private final CartService cartService;

    @GetMapping
    public Result getCarts(){
        List<CartInfo> list = cartService.getCarts();
        return Result.success(list);
    }
}
